import axios from '@/libs/api.request.js'

const api = "access";

export const login = data => {
    return axios.request({
        url:`${api}/login`,
        data:data,
        method:"post"
    });
};

export const getUserInfo = () => {
    return axios.request({
        url:`${api}/profile`,
        data:null,
        method: 'get'
    });
};



export const qrcode = () =>{
    return axios.request({
        url:`${api}/faceLogin/qrcode`,
        method:'get',
        data:null
    });
};

export const codeCheck = data =>{
    return axios.request({
        url:`${api}/faceLogin/qrcode/${data.code}`,
        method:'get',
        data:null
    });
};

export const checkFace = data => {
/*    let config = {};
    config.data = data;
    config.headers = {
        'Cache-Control': 'no-cache',
        'Content-Type': 'multipart/form-data'
    };
    config.transformRequest = data;*/
    return axios.request({
        header:{
            'Cache-Control': 'no-cache',
            'Content-Type': 'multipart/form-data'
        },
        method: 'post',
        url: `${api}/faceLogin/checkFace`,

        //...config
    });
};


